home *** CD-ROM | disk | FTP | other *** search
Wrap
on startMovie global human, player1, player2 repeat with i = 15 to 48 set the visible of sprite i to 0 end repeat repeat with i = 1 to 15 set the visible of sprite i to 1 end repeat set human to [] set player1 to [] set player2 to [] end on startRound global game, human, player1, player2, CDPath, HDPath if getAt(human, 12) = 1 then setAt(human, 12, 0) end if if getAt(player1, 12) = 1 then setAt(player1, 12, 0) end if if getAt(player2, 12) = 1 then setAt(player2, 12, 0) end if if getAt(player1, 12) = 0 then repeat with X = 66 to 72 set the visible of sprite X to 0 end repeat end if if getAt(player2, 12) = 0 then repeat with X = 73 to 79 set the visible of sprite X to 0 end repeat end if updateStage() setAt(game, 25, 3) updateGold() setAt(game, 4, 0) setAt(game, 11, 0) setAt(game, 20, 0) setAt(human, 21, 0) setAt(player1, 21, 0) setAt(player2, 21, 0) setAt(human, 22, 0) setAt(player1, 22, 0) setAt(player2, 22, 0) setAt(player1, 34, 0) setAt(player2, 34, 0) repeat with i = 27 to 30 setAt(player1, i, 0) setAt(player2, i, 0) end repeat setAt(game, 1, 0) setAt(game, 9, 1) setAt(game, 10, 0) repeat with i = 1 to 5 setAt(human, i + 5, 1) setAt(player1, i + 5, 1) setAt(player2, i + 5, 1) setAt(human, i, -2) setAt(player1, i, -2) setAt(player2, i, -2) end repeat if (getAt(game, 6) = 0) and (getAt(human, 12) > 1) then setAt(game, 6, 1) end if if (getAt(game, 6) = 1) and (getAt(player1, 12) > 1) then setAt(game, 6, 2) end if if (getAt(game, 6) = 2) and (getAt(player2, 12) > 1) then setAt(game, 6, 0) end if set anteAmt to 0 if getAt(human, 12) = 0 then set anteAmt to anteAmt + getAt(game, 15) setAt(human, 11, getAt(human, 11) - getAt(game, 15)) end if if getAt(player1, 12) = 0 then set anteAmt to anteAmt + getAt(game, 15) setAt(player1, 11, getAt(player1, 11) - getAt(game, 15)) end if if getAt(player2, 12) = 0 then set anteAmt to anteAmt + getAt(game, 15) setAt(player2, 11, getAt(player2, 11) - getAt(game, 15)) end if setAt(game, 2, getAt(game, 2) + anteAmt) setAt(game, 1, 1) displayAmounts() updateGold() shuffleDeck() deal(human) checkResults(human) displayHumanCards() if getAt(player1, 12) = 0 then deal(player1) checkResults(player1) case getAt(player1, 13) of 1: set whichClip to "1a_i" 2: set whichClip to "2a_i" 3: set whichClip to "3a_i" 4: set whichClip to "4a_i" end case if getAt(player1, 18) then startVid(player1, whichClip, HDPath, 0) end if end if if getAt(player2, 12) = 0 then deal(player2) checkResults(player2) case getAt(player2, 13) of 1: set whichClip to "1a_i" 2: set whichClip to "2a_i" 3: set whichClip to "3a_i" 4: set whichClip to "4a_i" end case if getAt(player2, 18) then startVid(player2, whichClip, HDPath, 0) end if end if if (getAt(human, 12) = 0) and (getAt(human, 11) < 0) then setAt(human, 11, getAt(game, 13) + getAt(human, 11)) setAt(human, 22, 1) displayAmounts() end if if (getAt(player1, 12) = 0) and (getAt(player1, 11) < 0) then set result to getAt(player1, 16) & " sells an article of clothing for $" & getAt(game, 13) & "." put the text of member "result" into field "dynahelp" setAt(player1, 11, getAt(player1, 11) + getAt(game, 13)) setAt(player1, 22, 1) doComputerSell(player1) else if (getAt(player2, 12) = 0) and (getAt(player2, 11) < 0) then set result to getAt(player2, 16) & " sells an article of clothing for $" & getAt(game, 13) & "." put the text of member "result" into field "dynahelp" setAt(player2, 11, getAt(player2, 11) + getAt(game, 13)) setAt(player2, 22, 1) doComputerSell(player2) else contStart() end if end if end on contStart global game, player1, player2 case getAt(game, 6) of 0: put "Call, bet, or fold." into field "result" put the text of member "result" into field "dynahelp" showButtonsCall() showBetButtons() 1: computersTurn(player1) 2: computersTurn(player2) end case end on seeWhoWon global human, player1, player2 if getAt(player1, 12) = 0 then repeat with X = 1 to 5 set the member of sprite (66 + X) to member (getAt(player1, X) + 1) of castLib "Cards-Small" set the visible of sprite (66 + X) to 1 end repeat set the visible of sprite 66 to 1 set the visible of sprite 72 to 1 end if if getAt(player2, 12) = 0 then repeat with X = 1 to 5 set the member of sprite (73 + X) to member (getAt(player2, X) + 1) of castLib "Cards-Small" set the visible of sprite (73 + X) to 1 end repeat set the visible of sprite 73 to 1 set the visible of sprite 79 to 1 end if updateStage() if getAt(human, 12) > 0 then set wintest1 to compareHands(player1, player2) case wintest1 of 1: declareWinner(player1) 2: declareWinner(player2) end case else if getAt(player1, 12) > 0 then set wintest1 to compareHands(human, player2) case wintest1 of 1: declareWinner(human) 2: declareWinner(player2) end case else if getAt(player2, 12) > 0 then set wintest1 to compareHands(human, player1) case wintest1 of 1: declareWinner(human) 2: declareWinner(player1) end case else set wintest1 to compareHands(human, player1) if wintest1 = 1 then set wintest2 to compareHands(human, player2) if wintest2 = 1 then declareWinner(human) else if wintest2 = 2 then declareWinner(player2) else declareWinner(human) end if end if else set wintest3 to compareHands(player1, player2) if wintest3 = 1 then declareWinner(player1) else if wintest3 = 2 then declareWinner(player2) else declareWinner(player1) end if end if end if end if end if end if end on declareWinner thePlayer global handStr, game, player1, player2, CDPath set winner to getAt(thePlayer, 20) set allFold to 0 set whichClip to EMPTY if ((getAt(player1, 12) > 0) and (getAt(player2, 12) > 0)) or ((getAt(human, 12) > 0) and (getAt(player2, 12) > 0)) or ((getAt(human, 12) > 0) and (getAt(player1, 12) > 0)) then set allFold to 1 end if if winner > 0 then if allFold then put getAt(thePlayer, 16) & " wins $" & getAt(game, 2) & "." into field "result" put the text of member "result" into field "dynahelp" else put getAt(thePlayer, 16) & " wins $" & getAt(game, 2) & " with " & getAt(handsStr, getAt(thePlayer, 14)) & "." into field "result" put the text of member "result" into field "dynahelp" end if else if allFold then put "You win $" & getAt(game, 2) & "." into field "result" put the text of member "result" into field "dynahelp" else put "You win $" & getAt(game, 2) & " with " & getAt(handsStr, getAt(thePlayer, 14)) & "." into field "result" put the text of member "result" into field "dynahelp" end if end if updateStage() setAt(thePlayer, 11, getAt(thePlayer, 11) + getAt(game, 2)) setAt(game, 2, 0) if (winner = 0) and (getAt(human, 22) = 1) then setAt(human, 11, getAt(human, 11) - getAt(game, 13)) end if displayAmounts() set doit to 0 setAt(game, 1, 0) set flash to 0 if (winner > 0) and (getAt(human, 22) = 1) then setAt(human, 13, getAt(human, 13) + 1) put the text of member "result" & " You lose an article of clothing." into field "result" put the text of member "result" into field "dynahelp" set flash to 1 if getAt(human, 13) = 5 then setAt(human, 12, 4) end if end if set clothesFlag to getAt(thePlayer, 22) set playerState to getAt(thePlayer, 13) if winner > 0 then if clothesFlag = 0 then if getAt(human, 12) = 4 then setAt(human, 12, 2) case playerState of 1: set whichClip to "1b_j" 2: set whichClip to "2b_j" 3: set whichClip to "3b_j" 4: set whichClip to "4b_j" end case else case playerState of 1: set whichClip to "1b_i" 2: set whichClip to "2b_i" 3: set whichClip to "3b_i" 4: set whichClip to "4b_i" end case end if else setAt(thePlayer, 11, getAt(thePlayer, 11) - getAt(game, 13)) if getAt(human, 12) = 4 then setAt(human, 12, 2) case playerState of 1: set whichClip to "1b_j" 2: set whichClip to "2b_j" 3: set whichClip to "3b_j" 4: set whichClip to "4b_j" end case else case playerState of 1: set whichClip to "1a_g" 2: set whichClip to "2a_g" 3: set whichClip to "3a_g" 4: set whichClip to "4a_g" end case displayAmounts() end if end if startVid(thePlayer, whichClip, CDPath, 1) setAt(thePlayer, 23, 1) setAt(game, 10, 4) if flash = 1 then puppetSound(1, "meter") displayStatusBar() updateStage() end if else if getAt(player1, 22) = 1 then set doit to 1 set thePlayer to player1 else if getAt(player2, 22) = 1 then set thePlayer to player2 set doit to 1 else resetButtons() end if end if end if if doit = 1 then set playerState to getAt(thePlayer, 13) case playerState of 1: set whichClip to "1b_k" setAt(thePlayer, 13, 2) 2: set whichClip to "2b_k" setAt(thePlayer, 13, 3) 3: set whichClip to "3b_k" setAt(thePlayer, 13, 4) 4: set whichClip to "4b_k" setAt(thePlayer, 13, 5) setAt(thePlayer, 12, 2) set the member of sprite 48 to "toy-dwnright-dimmed" end case startVid(thePlayer, whichClip, CDPath, 1) setAt(thePlayer, 23, 1) setAt(game, 10, 4) setAt(thePlayer, 22, 0) end if if (winner = 0) and (whichClip = EMPTY) then doAnteUp() end if setAt(thePlayer, 22, 0) end on checkRound thePlayer global player1, player2, human, game setAt(game, 5, getAt(game, 5) + 1) if getAt(game, 5) = 3 then setAt(game, 9, getAt(game, 9) + 1) setAt(game, 5, 0) end if set gameCurBet to getAt(game, 4) set money to getAt(thePlayer, 11) set playerCurBet to getAt(thePlayer, 21) set round to getAt(game, 9) set maxRounds to getAt(game, 12) set newBet to gameCurBet - playerCurBet set endOfRound to 0 case getAt(game, 1) of 1: if round = 2 then set endOfRound to 1 end if 2: if newBet = 0 then set endOfRound to 1 end if 3: if round = 2 then set endOfRound to 1 end if 4: if round = 2 then set endOfRound to 1 end if 5: if newBet = 0 then set endOfRound to 1 end if end case if endOfRound then case getAt(game, 1) of 1: put "The pot stays and we deal new cards." into field "result" put the text of member "result" into field "dynahelp" setAt(game, 1, 0) doAnteUp() 2: if newBet = 0 then setAt(game, 9, 1) setAt(game, 20, 0) setAt(game, 1, 3) setAt(game, 5, 0) if (getAt(game, 6) = 0) and (getAt(human, 12) <> 0) then setAt(game, 6, 1) end if if (getAt(game, 6) = 1) and (getAt(player1, 12) <> 0) then setAt(game, 6, 2) end if if (getAt(game, 6) = 2) and (getAt(player2, 12) <> 0) then setAt(game, 6, 0) end if if getAt(game, 6) = 1 then doComputerDiscard(player1) else if getAt(game, 6) = 2 then doComputerDiscard(player2) else if getAt(human, 12) = 0 then disableButtons() disableBetButtons() showDiscardButton() put "Click cards you wish to discard." into field "result" put the text of member "result" into field "dynahelp" end if end if end if else if (getAt(game, 6) = 0) and (getAt(human, 12) <> 0) then setAt(game, 6, 1) end if if (getAt(game, 6) = 1) and (getAt(player1, 12) <> 0) then setAt(game, 6, 2) end if if (getAt(game, 6) = 2) and (getAt(player2, 12) <> 0) then setAt(game, 6, 0) end if set first to getAt(game, 6) if first = 1 then computersTurn(player1) else if first = 2 then computersTurn(player2) else showButtons() if getAt(game, 20) >= getAt(game, 21) then dispcallStatus() else dispraiseStatus() showBetButtons() end if end if end if end if 3: setAt(human, 21, 0) setAt(player1, 21, 0) setAt(player2, 21, 0) setAt(game, 4, 0) setAt(game, 1, 4) setAt(game, 9, 1) if (getAt(game, 6) = 0) and (getAt(human, 12) <> 0) then setAt(game, 6, 1) end if if (getAt(game, 6) = 1) and (getAt(player1, 12) <> 0) then setAt(game, 6, 2) end if if (getAt(game, 6) = 2) and (getAt(player2, 12) <> 0) then setAt(game, 6, 0) end if set first to getAt(game, 6) if first = 1 then computersTurn(player1) else if first = 2 then computersTurn(player2) else put "Call, bet, or fold." into field "result" put the text of member "result" into field "dynahelp" showButtonsCall() showBetButtons() end if end if 4: seeWhoWon() 5: if newBet = 0 then seeWhoWon() else if (getAt(game, 6) = 0) and (getAt(human, 12) <> 0) then setAt(game, 6, 1) end if if (getAt(game, 6) = 1) and (getAt(player1, 12) <> 0) then setAt(game, 6, 2) end if if (getAt(game, 6) = 2) and (getAt(player2, 12) <> 0) then setAt(game, 6, 0) end if set first to getAt(game, 6) if first = 1 then computersTurn(player1) else if first = 2 then computersTurn(player2) else showButtonsCall() if getAt(game, 20) >= getAt(game, 21) then dispcallStatus() else dispraiseStatus() showBetButtons() end if end if end if end if end case else if getAt(game, 20) = getAt(game, 21) then set lastRound to 1 else set lastRound to 0 end if nextPlayer(thePlayer, lastRound) end if end on dispraiseStatus global game, human set newBet to getAt(game, 4) - getAt(human, 21) put "Call, raise, or fold. The current bet is $" & newBet & "." into field "result" put the text of member "result" into field "dynahelp" end on dispcallStatus global game, human set newBet to getAt(game, 4) - getAt(human, 21) put "Call or fold. The current bet is $" & newBet & "." into field "result" put the text of member "result" into field "dynahelp" end on nextPlayer thePlayer, lastRound global game, human, player1, player2 if (getAt(thePlayer, 20) = 0) and (getAt(human, 12) <> 0) then checkRound(player1) else if (getAt(thePlayer, 20) = 1) and (getAt(player1, 12) <> 0) then checkRound(player2) else if (getAt(thePlayer, 20) = 2) and (getAt(player2, 12) <> 0) then checkRound(human) else case getAt(thePlayer, 20) of 0: if getAt(game, 1) = 3 then disableButtons() disableBetButtons() showDiscardButton() put "Click cards you wish to discard." into field "result" put the text of member "result" into field "dynahelp" else showButtonsCall() if lastRound then dispcallStatus() else if getAt(game, 4) then dispraiseStatus() else put "Call, bet, or fold." into field "result" put the text of member "result" into field "dynahelp" end if showBetButtons() end if end if 1: computersTurn(player1) 2: computersTurn(player2) end case end if end if end if end on checkWinGame global game, human, player1, player2 set hStatus to getAt(human, 12) set p1Status to getAt(player1, 12) set p2Status to getAt(player2, 12) if hStatus = 2 then hideMoney(0) end if if p1Status = 2 then hideMoney(1) end if if p2Status = 2 then hideMoney(2) end if if (hStatus = 2) and (p1Status > 1) then gameWinner(player2) else if (hStatus > 1) and (p2Status > 1) then gameWinner(player1) else if (p1Status > 1) and (p2Status > 1) then gameWinner(human) end if end if end if end on gameWinner thePlayer global game, human, player1, player2, CDPath if getAt(thePlayer, 20) = 0 then put "You won! All toys available." into field "result" put the text of member "result" into field "dynahelp" setAt(game, 10, 7) set the member of sprite 21 to member "pot-empty/blank" hidePotAmount() hideBigCards() hideButtons() else put getAt(thePlayer, 16) & " won the game!" into field "result" put the text of member "result" into field "dynahelp" if getAt(human, 12) <> 2 then set playerState to getAt(thePlayer, 13) case playerState of 1: set whichClip to "1b_h" 2: set whichClip to "2b_h" 3: set whichClip to "3b_h" 4: set whichClip to "4b_h" end case startVid(thePlayer, whichClip, CDPath, 1) setAt(thePlayer, 23, 1) setAt(game, 10, 7) end if end if end